<template>
    <div class="com-container">
        <div class="com-chart" ref='trend_ref'>

        </div>
    </div>
</template>

<script>
export default {
data(){
    return{
        chartInstance: null,
        allData:[]
    }
},
mounted(){
    this.initChart()
    this.getData()
    window.addEventListener('resize',this.screenAdapter)
    this.screenAdapter()
},
destroyed(){
        window.removeEventListener('resize',this.screenAdapter)
    },
methods:{
    initChart(){
        this.chartInstance = this.$echarts.init(this.$refs.trend_ref)
        const initOption = {}
        this.chartInstance.setOption(initOption)
    },
    getData(){
        //获取数据

        this.updateChart()
    },
    updateChart(){
        const dataOption = {}
        this.chartInstance.setOption(dataOption)
    },
    screenAdapter(){
        const adapterOption = {}
        this.chartInstance.setOption(adapterOption)
        this.chartInstance.resize()
    }    
}
}
</script>

<style>

</style>